import {
  transformerVariantGroup,
  transformerDirectives,
  presetAttributify,
  defineConfig,
  presetMini,
} from 'unocss';

// https://unocss.dev/config/#configuration
export default defineConfig({
  presets: [
    presetMini({ dark: 'class' }),
    presetAttributify({
      prefix: 'un-',// 自定义属性前缀，如u-text="red-500"
      prefixedOnly: true,// 仅识别带前缀的属性
    }),
  ],
  transformers: [transformerDirectives(), transformerVariantGroup()],
  // 快捷方式
  shortcuts: {
    'wh-full': 'w-full h-full',
    'flex-ac': 'flex justify-around items-center',
    'flex-bc': 'flex justify-between items-center',
  },

  // 主题
  theme: {
    colors: {
      'primary': 'var(--color-primary)',
      'success': 'var(--color-success)',
      'warning': 'var(--color-warning)',
      'error': 'var(--color-error)',
      'info': 'var(--color-info)',
      'theme': {
        'bg': 'var(--theme-bg)',
        'text': 'var(--theme-text)',
        'border': 'var(--theme-border)',
        'bg-secondary': 'var(--theme-bg-secondary)',
        'text-secondary': 'var(--theme-text-secondary)'
      }
    }
  },
});
